import request from '@/utils/request'

// 获取月卡列表
export function getCardListAPI(params) {
  return request({
    url: '/parking/card/list',
    method: 'get',
    params
  })
}
// 添加月卡
export const createCardAPI = (data) => request.post('/parking/card', data)

// 获取月卡详情

export const getCardDetailAPI = (id) => request.get(`/parking/card/detail/${id}`)

// 修改月卡
export const updateCardAPI = (data) => request.put('/parking/card/edit', data)

// 删除月卡
export const delCardAPI = (id) => request.delete(`/parking/card/${id}`)

// 批量删除月卡
// * @param {*} id
// * @returns
export function delCardListAPI(idList) {
  return request({
    url: `/parking/card/${idList.join(',')}`,
    method: 'DELETE'
  })
}
